package com.seari.service.impl;

import com.seari.bean.*;
import com.seari.dto.EquipmentLedgerAndInfoMaintenanceRequest;
import com.seari.mapper.EquipmentLedgerAndInfoMaintenanceMapper;
import com.seari.service.EquipmentLedgerAndInfoMaintenanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 设备台账和设备信息维护服务类
 *
 * @Author: zyk
 * @Date: 2020/1/3 16:00
 * @Version 1.0
 */
@Service
public class EquipmentLedgerAndInfoMaintenanceServiceImpl implements EquipmentLedgerAndInfoMaintenanceService {

    @Autowired
    private EquipmentLedgerAndInfoMaintenanceMapper mapper;


    @Override
    public List<ETInformation> getDeviceAccountBySystemNameAndEtName(EquipmentLedgerAndInfoMaintenanceRequest req) {
        return mapper.getDeviceAccountBySystemNameAndEtName(req);
    }

    @Override
    public int getAccountListCount() {
        return mapper.getAccountListCount();
    }

    @Override
    public List<ETInformation> getAttrAndValueByEId(String eid) {
        return mapper.getAttrAndValueByEId(eid);
    }

    @Override
    public List<PZLine> getLineList(Map<String, String> map) {
        return mapper.getLineList(map);
    }

    @Override
    public List<PZStation> getStationByParam(Station station) {
        return mapper.getStationByParam(station);
    }

    @Override
    public List<ETInformationExcel> getFMcAttrByParamsExcel(EquipmentLedgerAndInfoMaintenanceRequest req) {
        return mapper.getFMcAttrByParamsExcel(req);
    }

    @Override
    public Integer saveOrUpdateAttrValue(ETInformation etInformation) {
        if(etInformation.getEid() == null){
            return mapper.saveAttrValue(etInformation);
        }else{
            return mapper.updateMcAttr(etInformation);
        }
    }

    @Override
    public int deleteMcAttrByEId(String eid) {
        return mapper.deleteMcAttrByEId(eid);
    }

    @Override
    public List<ETMaintainRecord> getETMaintainRecordByTaskNum(String eid) {
        return mapper.getETMaintainRecordByTaskNum(eid);
    }

}
